//
//  NSString+Extension.h
//  VirtualCurrency
//
//  Created by apple on 2021/7/5.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Extension)

/**
 根据self字符串和文字大小返回宽高
 
 @param font 字体大小
 
 @return 字体宽高
 */
- (CGSize)getCharactersWithFont:(UIFont*)font;

/**
 根据self字符串和文字大小返回宽高
 
 @param font 字体大小
 @param maxSize 最大大小
 
 @return 字体宽高
 */
- (CGSize)getSizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize;

/** 对字符串进行MD5处理
 *
 *
 */
- (NSString *)md5;

+ (NSString *)getCurrentDeviceModel;

+ (NSString *)getPhoneVersion;

/* 验证手机号是否合法 */
+ (BOOL)isValidateMobile:(NSString *)mobile;

/* 验证邮箱是否合法 */
+ (BOOL)isValidateEmail:(NSString *)email;

/** 验证固定电话是否合法*/
+ (BOOL)isValidateFixedTelephone:(NSString *)fixedTelephone;

/** 验证是否合法*/
+ (BOOL)isMatchingWithRegularExpression:(NSString *)regularExpression text:(NSString *)text;
/**字符串混编*/
+(NSAttributedString *)getAttributeWith:(id)sender string:(NSString *)string orginFont:(CGFloat)orginFont orginColor:(UIColor *)orginColor attributeFont:(CGFloat)attributeFont attributeColor:(UIColor *)attributeColor;
//获取当前时间
+ (NSString *)currentDateForDateSeconds;
//格式化金额
+ (NSString *)stringChangeMoneyWithStr:(NSString *)str;

@end

NS_ASSUME_NONNULL_END
